import java.io.*;
import java.net.*;
//import java.util.concurrent.ExecutorService;
//import java.util.concurrent.Executors;

public class eServer {

	public static void main(String argv[]) throws Exception
	{
		String clientSentence;
		String capitalizedSentence;
		ServerSocket welcomeSocket = new ServerSocket
		(6789);


		while(true){
			Socket connectionSocket = welcomeSocket.accept();
			BufferedReader inFromClient =
				new BufferedReader(new InputStreamReader(
						connectionSocket.getInputStream()));
			DataOutputStream outToClient =
				new DataOutputStream(
						connectionSocket.getOutputStream());
			clientSentence = inFromClient.readLine();
			System.out.println("That little bitch said " + clientSentence);
			if (clientSentence != null){
				capitalizedSentence =
					clientSentence.toUpperCase() + '\n';
				outToClient.writeBytes(capitalizedSentence);
			}

		}
	}
} 